<?php

namespace App\Http\Middleware;

use Closure;

/**
 * IM系统绑定我方用户uid中间件
 * Class ImBinding
 * @package App\Http\Middleware
 */
class ImBinding
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $user_id = $request->input('user_id', '');//我用户id;
        if (!$user_id) {
            echo "请按F5刷新页面后再试";
            exit;
        }

        //执行绑定


        return $next($request);

    }
}
